Optimal. Leaf size=156 \[ -\frac {b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) x}{2 d^3}-\frac {2 (b c-a d)^3 \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d^3 \sqrt {c^2-d^2} f}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2872, 3102,
2814, 2739, 632, 210} \begin {gather*} -\frac {b x \left (-6 a^2 d^2+6 a b c d-\left (b^2 \left (2 c^2+d^2\right )\right )\right )}{2 d^3}-\frac {2 (b c-a d)^3 \text {ArcTan}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{d^3 f \sqrt {c^2-d^2}}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rule 2872
Rule 3102
Rubi steps
\begin {align*} \int \frac {(a+b \sin (e+f x))^3}{c+d \sin (e+f x)} \, dx &=-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}+\frac {\int \frac {b^3 c+2 a^3 d-b \left (a b c-6 a^2 d-b^2 d\right ) \sin (e+f x)-b^2 (2 b c-5 a d) \sin ^2(e+f x)}{c+d \sin (e+f x)} \, dx}{2 d}\\ &=\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}+\frac {\int \frac {d \left (b^3 c+2 a^3 d\right )-b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) \sin (e+f x)}{c+d \sin (e+f x)} \, dx}{2 d^2}\\ &=-\frac {b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) x}{2 d^3}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}-\frac {(b c-a d)^3 \int \frac {1}{c+d \sin (e+f x)} \, dx}{d^3}\\ &=-\frac {b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) x}{2 d^3}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}-\frac {\left (2 (b c-a d)^3\right ) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d^3 f}\\ &=-\frac {b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) x}{2 d^3}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}+\frac {\left (4 (b c-a d)^3\right ) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{d^3 f}\\ &=-\frac {b \left (6 a b c d-6 a^2 d^2-b^2 \left (2 c^2+d^2\right )\right ) x}{2 d^3}-\frac {2 (b c-a d)^3 \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d^3 \sqrt {c^2-d^2} f}+\frac {b^2 (2 b c-5 a d) \cos (e+f x)}{2 d^2 f}-\frac {b^2 \cos (e+f x) (a+b \sin (e+f x))}{2 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.39, size = 137, normalized size = 0.88 \begin {gather*} \frac {2 b \left (-6 a b c d+6 a^2 d^2+b^2 \left (2 c^2+d^2\right )\right ) (e+f x)-\frac {8 (b c-a d)^3 \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}+4 b^2 d (b c-3 a d) \cos (e+f x)-b^3 d^2 \sin (2 (e+f x))}{4 d^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 229, normalized size = 1.47
method | result | size |
derivativedivides | \(\frac {\frac {2 b \left (\frac {\frac {d^{2} b^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\left (-3 a b \,d^{2}+b^{2} c d \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {d^{2} b^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2}-3 a b \,d^{2}+b^{2} c d}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {\left (6 a^{2} d^{2}-6 a b c d +2 b^{2} c^{2}+d^{2} b^{2}\right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}\right )}{d^{3}}+\frac {2 \left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d^{3} \sqrt {c^{2}-d^{2}}}}{f}\) | \(229\) |
default | \(\frac {\frac {2 b \left (\frac {\frac {d^{2} b^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\left (-3 a b \,d^{2}+b^{2} c d \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {d^{2} b^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2}-3 a b \,d^{2}+b^{2} c d}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}+\frac {\left (6 a^{2} d^{2}-6 a b c d +2 b^{2} c^{2}+d^{2} b^{2}\right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}\right )}{d^{3}}+\frac {2 \left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d^{3} \sqrt {c^{2}-d^{2}}}}{f}\) | \(229\) |
risch | \(\frac {3 b x \,a^{2}}{d}-\frac {3 b^{2} x a c}{d^{2}}+\frac {b^{3} x \,c^{2}}{d^{3}}+\frac {b^{3} x}{2 d}-\frac {3 b^{2} {\mathrm e}^{i \left (f x +e \right )} a}{2 d f}+\frac {b^{3} {\mathrm e}^{i \left (f x +e \right )} c}{2 d^{2} f}-\frac {3 b^{2} {\mathrm e}^{-i \left (f x +e \right )} a}{2 d f}+\frac {b^{3} {\mathrm e}^{-i \left (f x +e \right )} c}{2 d^{2} f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{3}}{\sqrt {-c^{2}+d^{2}}\, f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{2} b c}{\sqrt {-c^{2}+d^{2}}\, f d}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a \,b^{2} c^{2}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) b^{3} c^{3}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{3}}{\sqrt {-c^{2}+d^{2}}\, f}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{2} b c}{\sqrt {-c^{2}+d^{2}}\, f d}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a \,b^{2} c^{2}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) b^{3} c^{3}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{3}}-\frac {b^{3} \sin \left (2 f x +2 e \right )}{4 f d}\) | \(733\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 593, normalized size = 3.80 \begin {gather*} \left [\frac {{\left (2 \, b^{3} c^{4} - 6 \, a b^{2} c^{3} d + 6 \, a b^{2} c d^{3} + {\left (6 \, a^{2} b - b^{3}\right )} c^{2} d^{2} - {\left (6 \, a^{2} b + b^{3}\right )} d^{4}\right )} f x - {\left (b^{3} c^{2} d^{2} - b^{3} d^{4}\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) + 2 \, {\left (b^{3} c^{3} d - 3 \, a b^{2} c^{2} d^{2} - b^{3} c d^{3} + 3 \, a b^{2} d^{4}\right )} \cos \left (f x + e\right )}{2 \, {\left (c^{2} d^{3} - d^{5}\right )} f}, \frac {{\left (2 \, b^{3} c^{4} - 6 \, a b^{2} c^{3} d + 6 \, a b^{2} c d^{3} + {\left (6 \, a^{2} b - b^{3}\right )} c^{2} d^{2} - {\left (6 \, a^{2} b + b^{3}\right )} d^{4}\right )} f x - {\left (b^{3} c^{2} d^{2} - b^{3} d^{4}\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right ) + 2 \, {\left (b^{3} c^{3} d - 3 \, a b^{2} c^{2} d^{2} - b^{3} c d^{3} + 3 \, a b^{2} d^{4}\right )} \cos \left (f x + e\right )}{2 \, {\left (c^{2} d^{3} - d^{5}\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 252, normalized size = 1.62 \begin {gather*} \frac {\frac {{\left (2 \, b^{3} c^{2} - 6 \, a b^{2} c d + 6 \, a^{2} b d^{2} + b^{3} d^{2}\right )} {\left (f x + e\right )}}{d^{3}} - \frac {4 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{\sqrt {c^{2} - d^{2}} d^{3}} + \frac {2 \, {\left (b^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2 \, b^{3} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 6 \, a b^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - b^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, b^{3} c - 6 \, a b^{2} d\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}^{2} d^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.56, size = 2500, normalized size = 16.03 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________